<template>
    <v-md-preview :include-level="[3, 4]" :text="markdownText"></v-md-preview>
</template>

<script setup lang="ts">
import {onMounted, ref} from "vue";
import hljs from 'highlight.js'
import {getMdFile} from "@/api/common/md.ts";

let markdownText = ref(`# Hello Vue Markdown`)
// let markdownText = ref(null)

onMounted(()=> {
    document.addEventListener('DOMContentLoaded', () => {
        hljs.initHighlightingOnLoad()
    })

    // markdownText.value = `# Hello Vue Markdown \n\r## Hello Vue Markdown`

    getMdFile("ctu9bl170k97mnftfup0").then((res) => {
        console.log(res.data.description)
        markdownText.value = res.data.description
    })
})
</script>

<style scoped lang="scss">

</style>
